import { DB } from "@/lib/db";
import { faker } from "@faker-js/faker";
import { roles, RoleSchema } from "@supersavely/db/schema";

const mock = () => {
  const data: Omit<Extract<RoleSchema, { mode: "addRole" }>, "mode">[] = [];

  data.push({
    name: "Admin",
    description: "Admin description",
  });
  data.push({
    name: "Anonymous",
    description: "Anonymous description",
  });
  data.push({
    name: "User",
    description: "User description",
  });
  data.push({
    name: "User VIP1",
    description: "Level 1 VIP user description",
  });
  data.push({
    name: "User VIP2",
    description: "Level 2 VIP user description",
  });

  return data;
};

export async function seed(db: DB) {
  console.log("start seeding roles");
  await db.insert(roles).values(mock());
}
